/**
 * Created by Administrator on 2016/8/3.
 */
/**
 * Created by Administrator on 2016/8/2.
 */
if($.cookie('petname')){
    location.href='/';
}

$('form').submit(function(e){
    alert ('1');
    e.preventDefault();
    location.href = '#';
    var data = $(this).serialize();
    console.log(data);
    $.post('/index',data,function(res){
        if(res.code == 'success'){
            location.href = '/';
        }else{
            // $('.modal-body').text(res.message);
            // $('.modal').modal('show');
            alert('res.message')
        }
    })
});

